<html>
    <head>
        <script type="text/javascript" src="jquery-1.8.3.min.js"></script>
        <script type="text/javascript">
        $(function(){
            var time = new Date().getTime();
            //time = timeFormat.toUTCString();
            setInterval('getMessage("'+time+'")',1000);
           getMessage(timeFormat);
        });

        function getMessage(time){
            var url = 'http://127.0.0.1/login.php?act=get_liveMsg';
            $.post(url,{time:time},function(data){
                //$('.msg').append('<span>'+data+'</span><br>');
                //return false;
                if(data === null ){
                    return;
                }else{
                    $.each(data.data,function(key,value){
                        $('.msg').append('<span>'+value.name+' '+value.time+':</span><span>'+value.text+'</span><br>');
                    })   
                }
                
            },'json');
        }
        </script>
    </head>
    <body>
        <div class="msg"></div>
    </body>
</html>
